<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            list-style: none;
        }

        #level1>li {
            float: left;
            width: 150px;
            height: 40px;
            background: #ccc;
            margin: 5px;
            position: relative;
        }
        #level1>li:hover .level2{
            display: block;
        }
        .level2{
            padding-left: 0;
            position: absolute;
            left: 0;
            top: 40px;
        }
        .level2{
            display: none;
        }
    </style>
</head>

<body>
    <ul id="level1">
        <li>
            一级菜单一
            <ul class="level2">
                <li>二级菜单 1</li>
                <li>二级菜单 2</li>
            </ul>
        </li>
        <li>
            一级菜单二
            <ul class="level2">
                <li>二级菜单 1</li>
                <li>二级菜单 2</li>
            </ul>
        </li>
        <li>
            一级菜单三
            <ul class="level2">
                <li>二级菜单 1</li>
                <li>二级菜单 2</li>
            </ul>
        </li>
    </ul>
</body>

</html>